<template>
	<view class="definite">
		<view class="list" v-if='list.length'>
			<view class="line dFlex jBetween_aCenter" v-for="(item,index) in list" :key='item.id'>
				<view class="lineDesc dFlex jStart_aCenter">
					<view class="lineIcon imgPublic">
						<image src="../static/images/cztb@2x.png" mode="widthFix"></image>
					</view>
					<view class="info">
						<view class="desc">{{item.memo}}</view>
						<view class="time">{{tools.timestamptoData((item.createtime).toString(),1)}}</view>
					</view>
				</view>
				<view class="amount">{{item.money}}</view>
			</view>
		</view>
		<u-empty mode="list" v-else icon="http://cdn.uviewui.com/uview/empty/car.png" text='暂无数据'></u-empty>
	</view>
</template>

<script>
	import { 
		getViperMoneyUseLog
	} from '@/tools/http.js';
	import tools from '@/tools/tools.js'
	export default {
		data() {
			return {
				list:[],
			};
		},
		onShow(){
			this.initLog();
		},
		methods:{
			async initLog(){
				let res = await getViperMoneyUseLog({});
				console.log(res);
				if(res && res.length){
					this.list = res;
				}else{
					this.list = [];
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: white;
	}
	.definite{
		width:100%;
		.list{
			width:100%;
			.line{
				width:100%;
				padding: 12px;
				box-sizing: border-box;
				border-bottom: 1px solid #E6E6E6;
				.lineDesc{
					flex:1;
					.info{
						flex:1;
						.desc{
							font-size: 15px;
							color:#808080;
							margin-bottom: 6px;
						}
						.time{
							font-size:12px;
						}
					}
					.lineIcon{
						width:44px;
						height:44px;
						margin-right: 10px;
					}
				}
				.amount{
					font-size: 20px;
					color: #ECC301;
					font-weight: bold;
				}
			}
		}
	}
</style>
